// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_PLAN_ORDER
// * CreateDate    : 2014-06-05 18:30:20
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:20
// * LastChanger   : 2014-06-05 18:30:20
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class ProdPlanOrderEntity : EntityBase
    {
        public ProdPlanOrderTable TableSchema
        {
            get
            {
                return ProdPlanOrderTable.Current;
            }
		}
		
		public ProdPlanOrderEntity()
        {

        }
		
		public ProdPlanOrderEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.SappItemId = Convert.ToString(CommonFunctions.ToObject(dr["SAPP_ITEM_ID"]));
			this.ContractModel = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_MODEL"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.BomId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ID"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.InvType = Convert.ToString(CommonFunctions.ToObject(dr["INV_TYPE"]));
			this.LocationCode = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_CODE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.BlueprintId = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_ID"]));
			this.PoUser = Convert.ToString(CommonFunctions.ToObject(dr["PO_USER"]));
			this.PoDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PO_DATE"]));
			this.ActualFinishDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ACTUAL_FINISH_DATE"]));
			this.IsMark = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.StartTime = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_TIME"]));
            this.IsMtrlHold = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MTRL_HOLD"]));
        }
		
		public ProdPlanOrderEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.CreatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["CREATED_DATE"]));
			this.CreatedBy = Convert.ToString(CommonFunctions.ToObject(dr["CREATED_BY"]));
			this.UpdatedDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["UPDATED_DATE"]));
			this.UpdatedBy = Convert.ToString(CommonFunctions.ToObject(dr["UPDATED_BY"]));
			this.PoNo = Convert.ToString(CommonFunctions.ToObject(dr["PO_NO"]));
			this.SappItemId = Convert.ToString(CommonFunctions.ToObject(dr["SAPP_ITEM_ID"]));
			this.ContractModel = Convert.ToString(CommonFunctions.ToObject(dr["CONTRACT_MODEL"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.BomId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ID"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.DeliveryDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["DELIVERY_DATE"]));
			this.InvType = Convert.ToString(CommonFunctions.ToObject(dr["INV_TYPE"]));
			this.LocationCode = Convert.ToString(CommonFunctions.ToObject(dr["LOCATION_CODE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.BlueprintId = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_ID"]));
			this.PoUser = Convert.ToString(CommonFunctions.ToObject(dr["PO_USER"]));
			this.PoDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["PO_DATE"]));
			this.ActualFinishDate = Convert.ToDateTime(CommonFunctions.ToObject(dr["ACTUAL_FINISH_DATE"]));
			this.IsMark = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MARK"]));
			this.Status = Convert.ToString(CommonFunctions.ToObject(dr["STATUS"]));
			this.StartTime = Convert.ToDateTime(CommonFunctions.ToObject(dr["START_TIME"]));
            this.IsMtrlHold = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_MTRL_HOLD"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return ProdPlanOrderTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_ID)); }
            set { SetData(ProdPlanOrderTable.C_ID, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(ProdPlanOrderTable.C_IS_ACTIVE)); }
            set { SetData(ProdPlanOrderTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public DateTime CreatedDate
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_CREATED_DATE)); }
            set { SetData(ProdPlanOrderTable.C_CREATED_DATE, value); }
        }
		
        [DataMember]
        public string CreatedBy
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_CREATED_BY)); }
            set { SetData(ProdPlanOrderTable.C_CREATED_BY, value); }
        }
		
        [DataMember]
        public DateTime UpdatedDate
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_UPDATED_DATE)); }
            set { SetData(ProdPlanOrderTable.C_UPDATED_DATE, value); }
        }
		
        [DataMember]
        public string UpdatedBy
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_UPDATED_BY)); }
            set { SetData(ProdPlanOrderTable.C_UPDATED_BY, value); }
        }
		
        [DataMember]
        public string PoNo
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_PO_NO)); }
            set { SetData(ProdPlanOrderTable.C_PO_NO, value); }
        }
		
        [DataMember]
        public string SappItemId
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_SAPP_ITEM_ID)); }
            set { SetData(ProdPlanOrderTable.C_SAPP_ITEM_ID, value); }
        }
		
        [DataMember]
        public string ContractModel
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_CONTRACT_MODEL)); }
            set { SetData(ProdPlanOrderTable.C_CONTRACT_MODEL, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_PRODUCT_ID)); }
            set { SetData(ProdPlanOrderTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string ProductName
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_PRODUCT_NAME)); }
            set { SetData(ProdPlanOrderTable.C_PRODUCT_NAME, value); }
        }
		
        [DataMember]
        public string ProductCode
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_PRODUCT_CODE)); }
            set { SetData(ProdPlanOrderTable.C_PRODUCT_CODE, value); }
        }
		
        [DataMember]
        public string BomId
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_BOM_ID)); }
            set { SetData(ProdPlanOrderTable.C_BOM_ID, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(ProdPlanOrderTable.C_QTY)); }
            set { SetData(ProdPlanOrderTable.C_QTY, value); }
        }
		
        [DataMember]
        public DateTime DeliveryDate
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_DELIVERY_DATE)); }
            set { SetData(ProdPlanOrderTable.C_DELIVERY_DATE, value); }
        }
		
        [DataMember]
        public string InvType
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_INV_TYPE)); }
            set { SetData(ProdPlanOrderTable.C_INV_TYPE, value); }
        }
		
        [DataMember]
        public string LocationCode
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_LOCATION_CODE)); }
            set { SetData(ProdPlanOrderTable.C_LOCATION_CODE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_REMARK)); }
            set { SetData(ProdPlanOrderTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string BlueprintId
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_BLUEPRINT_ID)); }
            set { SetData(ProdPlanOrderTable.C_BLUEPRINT_ID, value); }
        }
		
        [DataMember]
        public string PoUser
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_PO_USER)); }
            set { SetData(ProdPlanOrderTable.C_PO_USER, value); }
        }
		
        [DataMember]
        public DateTime PoDate
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_PO_DATE)); }
            set { SetData(ProdPlanOrderTable.C_PO_DATE, value); }
        }
		
        [DataMember]
        public DateTime ActualFinishDate
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_ACTUAL_FINISH_DATE)); }
            set { SetData(ProdPlanOrderTable.C_ACTUAL_FINISH_DATE, value); }
        }
		
        [DataMember]
        public int IsMark
        {
            get { return Convert.ToInt32(GetData(ProdPlanOrderTable.C_IS_MARK)); }
            set { SetData(ProdPlanOrderTable.C_IS_MARK, value); }
        }
		
        [DataMember]
        public string Status
        {
            get { return Convert.ToString(GetData(ProdPlanOrderTable.C_STATUS)); }
            set { SetData(ProdPlanOrderTable.C_STATUS, value); }
        }
		
        [DataMember]
        public DateTime StartTime
        {
            get { return Convert.ToDateTime(GetData(ProdPlanOrderTable.C_START_TIME)); }
            set { SetData(ProdPlanOrderTable.C_START_TIME, value); }
        }

        [DataMember]
        public int IsMtrlHold
        {
            get { return Convert.ToInt32(GetData(ProdPlanOrderTable.C_IS_MTRL_HOLD)); }
            set { SetData(ProdPlanOrderTable.C_IS_MTRL_HOLD, value); }
        }
		#endregion
	}
	
	
}	

